package com.ebupt.migu.globalpopup.enums;

import lombok.Getter;

/**
 * 会员类型枚举
 */
@Getter
public enum MemberEnum {
    MEMBER_ENUM0(0, 1,"非会员"),
    MEMBER_ENUM1(1, 2,"特级会员"),
    MEMBER_ENUM2(2, 3,"特级会员高清升级包"),
    MEMBER_ENUM3(3, 4,"白金+特级会员"),
    MEMBER_ENUM4(4, 5,"白金会员"),
    MEMBER_ENUM5(5, 6,"大战包"),
    MEMBER_ENUM6(6, 7,"联合会员"),
    MEMBER_ENUM7(7, 8,"白金会员体验版"),
    MEMBER_ENUM8(8, 9,"小时包"),
    MEMBER_ENUM9(9, 10,"5G畅玩包"),
    MEMBER_ENUM10(10, 11,"音乐包（客户端730去掉"),
    MEMBER_ENUM11(11, 12,"非音乐包（客户端730去掉）"),
    MEMBER_ENUM12(12, 13,"ikun会员"),
    MEMBER_ENUM13(13, 14,"白金会员尝鲜版"),
    MEMBER_ENUM14(16, 19,"M-ONE 尝鲜版"),
    MEMBER_ENUM15(15, 20,"M-ONE Light"),
    MEMBER_ENUM16(17, 15,"白金会员畅听版（20210610新增）"),
    MEMBER_ENUM17(18, 16,"日享包（20210610新增）"),
    MEMBER_ENUM18(19, 17," M_ZONE(20210817新增 "),
;
    final int code;
    final int key;
    final String name;

    MemberEnum(int code,int key, String name) {
        this.code = code;
        this.name = name;
        this.key = key;
    }

    public static String getCodeByName(int code) {
        for (MemberEnum v : values()) {
            if (v.getCode() == code) {
                return v.getName();
            }
        }
        return null;
    }

    public static Integer getKeyByCode(int key) {
        for (MemberEnum v : values()) {
            if (v.getKey() == key) {
                return v.getCode();
            }
        }
        return null;
    }


    public static Integer getNameByCode(String name) {
        for (MemberEnum v : values()) {
            if (v.getName().equals(name)) {
                return v.getCode();
            }
        }
        return null;
    }
}

